#ifndef CLIENTCORE_H
#define CLIENTCORE_H

#include <QObject>
#include <QSettings>
#include <QDir>
#include <QString>
#include <QCryptographicHash>
#include "core.h"
#include "client/client.h"

class Client;
class Core;

class ClientCore : public QObject
{
    Q_OBJECT
public:
    explicit ClientCore(Core *parent = 0);
    
    QString clientConfigPath;
    bool removeClient(const QString clientAlias);
    bool removeClient(Client *client);
    bool newClient(const QString configFile);
    bool hasClient(const QString clientAlias);
    bool hasClient(Client *client);
    Client *getClient(const QString clientAlias);

    static QString getClientConfigPath(){
        return QDir::currentPath().append("/clients/");
    }

    int getClientsCount(){
        return clients.count();
    }

    void sendConnectSignal();
    void sendDisconnectSignal();
private:
    QHash<QString, Client*> clients;

    Core* parent;

signals:
    
public slots:
    void clientUnloaded(const QString alias, const QString reason);
};

#endif // CLIENTCORE_H
